<html>
<body>
Welcome  <?php echo $_POST['studentname']; ?> </br>

<?php
    /* PROGRAM 1 ( wrote code like C laguage)
     $result=0;
     $course = array("Java","Scala","Python","C","C++");
     for ($i=0;$i<5;$i++)
     {
     if ($_POST['coursename'] == $course[$i])
     {
     $result = 1;
     break;
     }
     
     }
     
     if ($result == 1)
     {
     echo " The course is available";
     }
     
     else
     {
     echo " The course is not available / Invalid input ";
     } */
    
     /*PROGRAM 2 ( used strlower and in_array function)*/
     
     
     $course_selected = strtolower ($_POST['coursename1']);
     $course = array("java","scala","python","c","cpp");
    
    
     if (in_array($course_selected , $course)){
     echo "Course is available \n";
         
     }
     else {
     echo " The course is not available / Invalid input ";
     }
    
    echo "yipeeee";
    ?>

</body>
</html>

